package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 林地交易指标申请 实体类。
 *
 * @author 11987
 * @since 2025-04-18
 */
@Table(value = "LINDI_TRADE_APPLICATION", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiTradeApplication extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 交易指标申请ID
     */
    private Long tradeApplicationId;

    /**
     * 企业用户ID
     */
    private Long enterpriseAccountId;

    /**
     * 项目名称
     */
    private String projectName;

    /**
     * 项目地址
     */
    private String projectLocation;

    /**
     * 交易状态
     */
    private Integer tradeStatus;

    /**
     * 交易指标编号
     */
    private String tradeCode;

    /**
     * 申请购买面积-市储备库指标(亩)
     */
    private String reserveArea;

    /**
     * 申请购买面积-省级公益林(亩)
     */
    private String publicForestArea;

    /**
     * 市储备库金额
     */
    private BigDecimal reserveAreaMoney;

    /**
     * 省级公益林金额
     */
    private BigDecimal publicForestAreaMoney;

    /**
     * 情况简介（体现土地四至以及备案号/立项项目编码/文件批复等）
     */
    private String projectSituation;

    /**
     * 红线图文件ID
     */
    private Long redlineMapId;

    /**
     * 拒绝原因
     */
    private String refuseReason;

    /**
     * 项目类型
     */
    private String projectType;

    /**
     * 项目金额
     */
    private String money;

    /**
     * 购买理由
     */
    private String reason;

    /**
     * 申请时间
     */
    private LocalDateTime applicationTime;

    /**
     * 总面积(亩)
     */
    private String totalArea;

    /**
     * 申请理由
     */
    private String applicationReason;

    // 无参构造函数
    public LindiTradeApplication(){
    }

    // 全参构造函数
    public LindiTradeApplication(Long tradeApplicationId, Long enterpriseAccountId, String projectName, String projectLocation, Integer tradeStatus, String tradeCode, String reserveArea, String publicForestArea, BigDecimal reserveAreaMoney, BigDecimal publicForestAreaMoney, String projectSituation, Long redlineMapId, String refuseReason, String projectType, String money, String reason, LocalDateTime applicationTime, String totalArea, String applicationReason){
        this.tradeApplicationId = tradeApplicationId;
        this.enterpriseAccountId = enterpriseAccountId;
        this.projectName = projectName;
        this.projectLocation = projectLocation;
        this.tradeStatus = tradeStatus;
        this.tradeCode = tradeCode;
        this.reserveArea = reserveArea;
        this.publicForestArea = publicForestArea;
        this.reserveAreaMoney = reserveAreaMoney;
        this.publicForestAreaMoney = publicForestAreaMoney;
        this.projectSituation = projectSituation;
        this.redlineMapId = redlineMapId;
        this.refuseReason = refuseReason;
        this.projectType = projectType;
        this.money = money;
        this.reason = reason;
        this.applicationTime = applicationTime;
        this.totalArea = totalArea;
        this.applicationReason = applicationReason;
    }

    // Getter 和 Setter 方法
    public Long getTradeApplicationId(){
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId){
        this.tradeApplicationId = tradeApplicationId;
    }

    public Long getEnterpriseAccountId(){
        return enterpriseAccountId;
    }

    public void setEnterpriseAccountId(Long enterpriseAccountId){
        this.enterpriseAccountId = enterpriseAccountId;
    }

    public String getProjectName(){
        return projectName;
    }

    public void setProjectName(String projectName){
        this.projectName = projectName;
    }

    public String getProjectLocation(){
        return projectLocation;
    }

    public void setProjectLocation(String projectLocation){
        this.projectLocation = projectLocation;
    }

    public Integer getTradeStatus(){
        return tradeStatus;
    }

    public void setTradeStatus(Integer tradeStatus){
        this.tradeStatus = tradeStatus;
    }

    public String getTradeCode(){
        return tradeCode;
    }

    public void setTradeCode(String tradeCode){
        this.tradeCode = tradeCode;
    }

    public String getReserveArea(){
        return reserveArea;
    }

    public void setReserveArea(String reserveArea){
        this.reserveArea = reserveArea;
    }

    public String getPublicForestArea(){
        return publicForestArea;
    }

    public void setPublicForestArea(String publicForestArea){
        this.publicForestArea = publicForestArea;
    }

    public BigDecimal getReserveAreaMoney(){
        return reserveAreaMoney;
    }

    public void setReserveAreaMoney(BigDecimal reserveAreaMoney){
        this.reserveAreaMoney = reserveAreaMoney;
    }

    public BigDecimal getPublicForestAreaMoney(){
        return publicForestAreaMoney;
    }

    public void setPublicForestAreaMoney(BigDecimal publicForestAreaMoney){
        this.publicForestAreaMoney = publicForestAreaMoney;
    }

    public String getProjectSituation(){
        return projectSituation;
    }

    public void setProjectSituation(String projectSituation){
        this.projectSituation = projectSituation;
    }

    public Long getRedlineMapId(){
        return redlineMapId;
    }

    public void setRedlineMapId(Long redlineMapId){
        this.redlineMapId = redlineMapId;
    }

    public String getRefuseReason(){
        return refuseReason;
    }

    public void setRefuseReason(String refuseReason){
        this.refuseReason = refuseReason;
    }

    public String getProjectType(){
        return projectType;
    }

    public void setProjectType(String projectType){
        this.projectType = projectType;
    }

    public String getMoney(){
        return money;
    }

    public void setMoney(String money){
        this.money = money;
    }

    public String getReason(){
        return reason;
    }

    public void setReason(String reason){
        this.reason = reason;
    }

    public LocalDateTime getApplicationTime(){
        return applicationTime;
    }

    public void setApplicationTime(LocalDateTime applicationTime){
        this.applicationTime = applicationTime;
    }

    public String getTotalArea(){
        return totalArea;
    }

    public void setTotalArea(String totalArea){
        this.totalArea = totalArea;
    }

    public String getApplicationReason(){
        return applicationReason;
    }

    public void setApplicationReason(String applicationReason){
        this.applicationReason = applicationReason;
    }

    @Override
    public boolean equals(Object o){
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiTradeApplication that = (LindiTradeApplication) o;
        return java.util.Objects.equals(tradeApplicationId, that.tradeApplicationId) &&
                java.util.Objects.equals(enterpriseAccountId, that.enterpriseAccountId) &&
                java.util.Objects.equals(projectName, that.projectName) &&
                java.util.Objects.equals(projectLocation, that.projectLocation) &&
                java.util.Objects.equals(tradeStatus, that.tradeStatus) &&
                java.util.Objects.equals(tradeCode, that.tradeCode) &&
                java.util.Objects.equals(reserveArea, that.reserveArea) &&
                java.util.Objects.equals(publicForestArea, that.publicForestArea) &&
                java.util.Objects.equals(reserveAreaMoney, that.reserveAreaMoney) &&
                java.util.Objects.equals(publicForestAreaMoney, that.publicForestAreaMoney) &&
                java.util.Objects.equals(projectSituation, that.projectSituation) &&
                java.util.Objects.equals(redlineMapId, that.redlineMapId) &&
                java.util.Objects.equals(refuseReason, that.refuseReason) &&
                java.util.Objects.equals(projectType, that.projectType) &&
                java.util.Objects.equals(money, that.money) &&
                java.util.Objects.equals(reason, that.reason) &&
                java.util.Objects.equals(applicationTime, that.applicationTime) &&
                java.util.Objects.equals(totalArea, that.totalArea) &&
                java.util.Objects.equals(applicationReason, that.applicationReason);
    }

    @Override
    public int hashCode(){
        return java.util.Objects.hash(super.hashCode(), tradeApplicationId, enterpriseAccountId, projectName, projectLocation, tradeStatus, tradeCode, reserveArea, publicForestArea, reserveAreaMoney, publicForestAreaMoney, projectSituation, redlineMapId, refuseReason, projectType, money, reason, applicationTime, totalArea, applicationReason);
    }

    @Override
    public String toString(){
        return "LindiTradeApplication{" +
                "tradeApplicationId=" + tradeApplicationId +
                ", enterpriseAccountId=" + enterpriseAccountId +
                ", projectName='" + projectName + '\'' +
                ", projectLocation='" + projectLocation + '\'' +
                ", tradeStatus=" + tradeStatus +
                ", tradeCode='" + tradeCode + '\'' +
                ", reserveArea='" + reserveArea + '\'' +
                ", publicForestArea='" + publicForestArea + '\'' +
                ", reserveAreaMoney=" + reserveAreaMoney +
                ", publicForestAreaMoney=" + publicForestAreaMoney +
                ", projectSituation='" + projectSituation + '\'' +
                ", redlineMapId=" + redlineMapId +
                ", refuseReason='" + refuseReason + '\'' +
                ", projectType='" + projectType + '\'' +
                ", money='" + money + '\'' +
                ", reason='" + reason + '\'' +
                ", applicationTime=" + applicationTime +
                ", totalArea='" + totalArea + '\'' +
                ", applicationReason='" + applicationReason + '\'' +
                '}';
    }

    // Builder 类
    public static class Builder{
        private Long tradeApplicationId;
        private Long enterpriseAccountId;
        private String projectName;
        private String projectLocation;
        private Integer tradeStatus;
        private String tradeCode;
        private String reserveArea;
        private String publicForestArea;
        private BigDecimal reserveAreaMoney;
        private BigDecimal publicForestAreaMoney;
        private String projectSituation;
        private Long redlineMapId;
        private String refuseReason;
        private String projectType;
        private String money;
        private String reason;
        private LocalDateTime applicationTime;
        private String totalArea;
        private String applicationReason;

        public Builder tradeApplicationId(Long tradeApplicationId){
            this.tradeApplicationId = tradeApplicationId;
            return this;
        }

        public Builder enterpriseAccountId(Long enterpriseAccountId){
            this.enterpriseAccountId = enterpriseAccountId;
            return this;
        }

        public Builder projectName(String projectName){
            this.projectName = projectName;
            return this;
        }

        public Builder projectLocation(String projectLocation){
            this.projectLocation = projectLocation;
            return this;
        }

        public Builder tradeStatus(Integer tradeStatus){
            this.tradeStatus = tradeStatus;
            return this;
        }

        public Builder tradeCode(String tradeCode){
            this.tradeCode = tradeCode;
            return this;
        }

        public Builder reserveArea(String reserveArea){
            this.reserveArea = reserveArea;
            return this;
        }

        public Builder publicForestArea(String publicForestArea){
            this.publicForestArea = publicForestArea;
            return this;
        }

        public Builder reserveAreaMoney(BigDecimal reserveAreaMoney){
            this.reserveAreaMoney = reserveAreaMoney;
            return this;
        }

        public Builder publicForestAreaMoney(BigDecimal publicForestAreaMoney){
            this.publicForestAreaMoney = publicForestAreaMoney;
            return this;
        }

        public Builder projectSituation(String projectSituation){
            this.projectSituation = projectSituation;
            return this;
        }

        public Builder redlineMapId(Long redlineMapId){
            this.redlineMapId = redlineMapId;
            return this;
        }

        public Builder refuseReason(String refuseReason){
            this.refuseReason = refuseReason;
            return this;
        }

        public Builder projectType(String projectType){
            this.projectType = projectType;
            return this;
        }

        public Builder money(String money){
            this.money = money;
            return this;
        }

        public Builder reason(String reason){
            this.reason = reason;
            return this;
        }

        public Builder applicationTime(LocalDateTime applicationTime){
            this.applicationTime = applicationTime;
            return this;
        }

        public Builder totalArea(String totalArea){
            this.totalArea = totalArea;
            return this;
        }

        public Builder applicationReason(String applicationReason){
            this.applicationReason = applicationReason;
            return this;
        }

        public LindiTradeApplication build(){
            return new LindiTradeApplication(tradeApplicationId, enterpriseAccountId, projectName, projectLocation, tradeStatus, tradeCode, reserveArea, publicForestArea, reserveAreaMoney, publicForestAreaMoney, projectSituation, redlineMapId, refuseReason, projectType, money, reason, applicationTime, totalArea, applicationReason);
        }
    }

    public static Builder builder(){
        return new Builder();
    }

}
